//
//  InformationCell.m
//  TenThousand
//
//  Created by 王 on 16/7/29.
//  Copyright © 2016年 baixue. All rights reserved.
//

#import "InformationCell.h"

@implementation InformationCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setDataWithModel:(InforModel *)model {
    self.sex.text = [NSString stringWithFormat:@"性别：%@", model.Sex];
    self.marry.text = [NSString stringWithFormat:@"婚姻状况：%@", model.Marriage];
    self.company.text = [NSString stringWithFormat:@"企业状况：%@", model.Enterprise];
    self.workInfo.text = [NSString stringWithFormat:@"工作情况：%@", model.Working];
    self.sitWhere.text = [NSString stringWithFormat:@"所在地：%@", model.SitWhere];
    self.house.text = [NSString stringWithFormat:@"住宅情况：%@", model.Housing];
    self.income.text = [NSString stringWithFormat:@"月收入：%@", model.Pretax];
    self.education.text = [NSString stringWithFormat:@"最高学历：%@", model.Education];
}

- (void)cellAutoLayoutHeight:(NSString *)str {
    self.detail.lineBreakMode = NSLineBreakByWordWrapping;
    self.detail.preferredMaxLayoutWidth = CGRectGetWidth(self.detail.frame);
    NSMutableAttributedString * attributedString1 = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"借款描述：%@", str]];
    NSMutableParagraphStyle * paragraphStyle1 = [[NSMutableParagraphStyle alloc] init];
    [paragraphStyle1 setLineSpacing:8];
    [attributedString1 addAttribute:NSParagraphStyleAttributeName value:paragraphStyle1 range:NSMakeRange(0, [str length])];
    [self.detail setAttributedText:attributedString1];
}

@end
